@layout("/common/_curd/_container.html"){

<!-- PAGE CONTENT BEGINS -->
    <div class="widget-box">

        <div class="widget-body">
            <div class="widget-main">
                <!-- #section:plugins/fuelux.wizard.container -->
                <div class="step-content pos-rel" id="step-container">
                    <div class="step-pane active" id="step1">
                        <form class="form-horizontal" id="validation-form" method="post">

                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-3 no-padding-right">选择文件</label>

                                <div class="col-xs-12 col-sm-9">
                                    <div class="clearfix">
                                        <div class="cover-area" style="width: 80%;border-radius:5px;padding: 5px 0 0 5px;">
                                            <div class="cover-hd">
                                                <input id="import" name="import" type="file" />
                                                <input id="applyFile" class="cover-input" value="" name="applyFile" type="hidden" />
                                            </div>
                                            <p id="upload-tip" class="upload-tip"></p>
                                            <p id="actfile" class="cover-bd" style="display">
                                                <a class="vb cover-del" href="#" style="width: 600px;"></a>
                                            </p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-3 no-padding-right">查看结果</label>

                                <div class="col-xs-12 col-sm-9">
                                    <div class="clearfix">
                                        <div class="cover-area" id="result" style="width: 80%;border-radius:5px;padding: 5px 0 0 5px;">

                                        </div>
                                    </div>
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
            </div><!-- /.widget-main -->
        </div><!-- /.widget-body -->
    </div>

<script>
    jQuery(function($) {

        $('#import').uploadify({
            //校验数据
            'swf' : '${basePath}/static/uploadify/uploadify.swf', //指定上传控件的主体文件，默认‘uploader.swf’
            'uploader' : '${basePath}/${code}/doImport', //指定服务器端上传处理文件，默认‘upload.php’
            'auto' : true, //手动上传
            'buttonImage' : '${basePath}/static/uploadify/uploadify-upload.png', //浏览按钮背景图片
            'width' :110,
            'height' :30,
            'cancelImg': '${basePath}/static/uploadify/uploadify-cancel.png',
            //'buttonText': '选 择应用',
            'multi' : false, //单文件上传
            'fileTypeExts' : '*.xlsx', //允许上传的文件后缀
            'fileSizeLimit' : '20MB', //上传文件的大小限制，单位为B, KB, MB, 或 GB
            'successTimeout' : 30, //成功等待时间
            'onUploadSuccess' : function(file, data,response) {//每成功完成一次文件上传时触发一次
                data=eval("["+data+"]")[0];
                if(data.code==0){
                    $("#result").html(data.message);
                    //layer.msg(data.message?data.message:"导入成功");
                    parent.reloadGrid();
                    //closeView();
                }else{
                    $("#result").html(data.message || "导入失败");
                    layer.msg(data.message?data.message:"导入失败")
                }
            },
            'onUploadError' : function(file, data, response) {//当上传返回错误时触发
                $("#result").html(data.message || "导入失败");
                layer.msg(data.message || "导入失败");
            }
        });

    });
</script>

<link rel="stylesheet" href="${basePath}/static/uploadify/uploadify.css" />
<script src="${basePath}/static/uploadify/jquery.uploadify.min.js" type="text/javascript" ></script>

@}
